local wdtx__boshiCardSkill = fk.CreateSkill {
  name = "wdtx__boshi_skill",
}

wdtx__boshiCardSkill:addEffect("cardskill", {
  name = "wdtx__boshi_skill",
  prompt = "#wdtx__boshi_skill",
  mod_target_filter = Util.TrueFunc,
  can_use = function(self, player, card)
    return not player:isProhibited(player, card)
  end,
  on_use = function(self, room, cardUseEvent)
    if not cardUseEvent.tos or #cardUseEvent.tos == 0 then
      cardUseEvent.tos = {  cardUseEvent.from }
    end
  end,
  on_effect = function(self, room, effect)
    local target = effect.to
    if target.dead then return end
    if room.logic.class.name == "wdtx_logic" and target.id > 0 then
      local Wdtx = room.logic.Wdtx
      local upcards = Wdtx:getCanUpCards(target:getCardIds("h"))
      if #upcards == 0 then room:doBroadcastNotify("ShowToast","手牌没有可升级") return end
      Wdtx:upCardsByTmp(upcards)
    end
  end
})

return wdtx__boshiCardSkill